//
//  BACommon.swift
//  BAweibo
//
//  Created by baggio on 2017/8/2.
//  Copyright © 2017年 baggio. All rights reserved.
//

//swift的文件默认是全局的

import UIKit


//屏幕宽度
let BA_SCREEN_WIDTH=UIScreen.main.bounds.width
//屏幕高度
let BA_SCREEN_HEIGHT=UIScreen.main.bounds.height
//屏幕大小
let BA_SCREEN_SIZE = UIScreen.main.bounds.size

//微博头像大小（宽==高）
let BA_HOME_CELL_WH: CGSize = CGSize(width: 35, height: 35)
//单条微博中元素间间距（水平==垂直）
let BA_HOME_CELL_MARGIN: CGFloat = 10
//配图中图与图的间距（水平==垂直）
let BA_HOME_PICTURE_MARGIN: CGFloat = 5

//app主题颜色
let BA_COLOR_APP_THEME=UIColor.orange
/*
 字一般用 UIColor.darkGray，不使用纯黑色
 背景一般用浅灰色 RGB(red: 235, green: 235, blue: 235)
 */


//获取颜色 RGB(red: 191, green: 251, blue: 197, alpha: 1)
func RGB(red:CGFloat,green:CGFloat,blue:CGFloat,alpha:CGFloat=1)->UIColor{
    return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: alpha)
}

//获取随机颜色
func randomColor()->UIColor{
    let r=arc4random()%256
    let g=arc4random()%256
    let b=arc4random()%256
    return RGB(red: CGFloat(r), green: CGFloat(g), blue: CGFloat(b))
}


//微博相关的应用信息
let BA_Weibo_AppKey = "3462607751" // client_id
let BA_Weibo_AppSecret = "b581651813ac0d7baf74d7977afdac97"
let BA_Weibo_Redirect_Uri = "https://www.baidu.com"
//微博测试账号密码
let BA_Weibo_LoginName = "wanghua_baggio@126.com"
let BA_Weibo_Password = "baggiobagg"


//// 微博相关的应用信息
//let BA_Weibo_AppKey = "1495040264"
//let BA_Weibo_AppSecret = "d184ce723267b07c8bfd9b5222f3a3f3"
//let BA_Weibo_Redirect_Uri = "http://www.baidu.com" // 无所谓 http 还是 https
//// 微博测试账号密码
////let BA_Weibo_LoginName = "rangyuan05788697@163.com"
////let BA_Weibo_Password = "bbb333"
//let BA_Weibo_LoginName = "jubeisi0516873@163.com"
//let BA_Weibo_Password = "958794"

//切换根控制器的通知
let BA_NOTIFICATION_SWITCH_ROOT_VC = NSNotification.Name("BA_NOTIFICATION_SWITCH_ROOT_VC")


//请求 https://api.weibo.com/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com
//同意授权后会重定向 http://www.example.com/response&code=CODE

